﻿#include <iostream>
using namespace std;
class Person
{
public:
	string       m_name;
	int            m_age;
	char         m_memo[50];
	Person()                                               //无参构造器
	{
		m_name.clear(); m_age = 0; memset(m_memo, 0, sizeof(m_memo));
		cout << "调用了Person构造函数。\n";
	}
	Person(string name)                           //一个参数构造器
	{
		m_name.clear(); m_age = 0; memset(m_memo, 0, sizeof(m_memo));
		cout << "调用了Person(name)构造函数。\n";
		m_name = name;
	}
	Person(string name, int age)                           //两个参数构造器
	{
		m_name.clear(); m_age = 0; memset(m_memo, 0, sizeof(m_memo));
		cout << "调用了Person(name,age)构造函数。\n";
		m_name = name; m_age = age;
	}
	~Person()
	{
		cout << "调用了~Person()\n";
	}
	void show();
};

void Person::show()
{
	cout << "姓名：" << this->m_name << ",年龄：" << this->m_age << ",备注" << this->m_memo << endl;
}
int main()
{
	//Person p; //不需要加括号
	Person p("三毛");
	//p.setValue("三毛", 29);
	p.show();
	p.~Person();//手动调用
}
